package com.exam.service;

import com.exam.dao.QuestionCustDao;
import com.exam.dao.QuestionDao;
import com.exam.entity.Question;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class QuestionService {

    @Autowired
    QuestionDao questionDao;

    @Autowired
    QuestionCustDao questionCustDao;

    public int add(Question question){
        return questionDao.insert(question);
    }

    public List<Question> getByQuery(Integer subject){
        return questionCustDao.getListByQuery(subject);
    }

}
